﻿using System;
using HiTeachers.Services;

namespace HiTeachers.Web
{
    public partial class confirmsubscribe : PageBase
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            var itemId = new Guid(Request["itid"]);
            var logEmail = LoggerEmailServices.GetById(itemId);

            if (logEmail == null)
            {
                divError.Visible = true;
                divSuccess.Visible = false;
                return;
            }

            logEmail.IsConfirmed = true;
            LoggerEmailServices.SaveOrUpdate(logEmail);
            divError.Visible = false;
            divSuccess.Visible = true;
        }
    }
}
